#version 460
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_shader_explicit_arithmetic_types_int64 : require

//#include "../../../../core/shader_std.h"
//#include "../../../../core/shader_curve.h"



layout(points) in;
//layout(triangles) in;
layout(line_strip, max_vertices=2) out;
//layout(triangle_strip, max_vertices=4) out;


layout(location = 0) in VS_GS_VERTEX {
	vec4 vVertB;
	vec4 vVertE;
	vec4 vColor;
	vec4 vPointB;
	vec4 vPointE;
	vec4 vEye;
	float vDis;
}vertex_in[];


layout(location = 0) out vec4 gColor;
layout(location = 1) out vec4 gEye;
layout(location = 2) out vec4 gPoint;
layout(location = 3) out float gDis;
out gl_PerVertex {
	vec4	gl_Position;
};

//vec3 pos[4] = {vec3(10.0, 10.0, 10), vec3(100.0, 10.0,-2), vec3(10.0, 100.0,0), vec3(100.0, 100.0,0)};

void main(void){
	//mat4 mat_proj = mat4(0);
	//float f = 100;
	//float n = 0.1;
	//float tanHalfFovy = tan(radians(45) * 0.5f);
	//mat_proj[0][0] = 1.0f / ((1920.0/1080.0) * tanHalfFovy);
	//mat_proj[1][1] = 1.0f / tanHalfFovy;
	//mat_proj[2][2] = f / (f - n);
	//mat_proj[2][3] = 1.0f;
	//mat_proj[3][2] = -(f * n) / (f - n);


	//gl_Position = vec4(pos[0], 1);
	////gl_Position = vec4(0,0,0,1);
	//gColor = vertex_in[0].vColor;
	//EmitVertex();
	//gl_Position = vec4(pos[1], 1);
	////gl_Position = vec4(1000,1000,0,1);
	//gColor = vertex_in[1].vColor;
	//EmitVertex();
	//gl_Position = vec4(pos[2], 1);
	////gl_Position = vec4(1000,1000,0,1);
	//gColor = vertex_in[2].vColor;
	//EmitVertex();
	//EndPrimitive();
	//return;

	gl_Position = vertex_in[0].vVertB;
	gPoint = vertex_in[0].vPointB;
	gColor = vertex_in[0].vColor;
	gEye = vertex_in[0].vEye;
	gDis = vertex_in[0].vDis;
	EmitVertex();


	gl_Position = vertex_in[0].vVertE;
	gPoint = vertex_in[0].vPointE;
	gColor = vertex_in[0].vColor;
	gEye = vertex_in[0].vEye;
	gDis = vertex_in[0].vDis;
	EmitVertex();

	EndPrimitive();
}



 